﻿jQuery.validator.addMethod("accountrange", function (value, element, params) {
    var min = params.min;
    var max = params.max;
    return value.length >= min && value.length <= max;
});
jQuery.validator.unobtrusive.adapters.add("accountrange", ["min", "max"], function (options) {
    options.rules["accountrange"] = {
        min: options.params.min,
        max: options.params.max
    };
    options.messages["accountrange"] = options.message;
});